package Control;

import javax.swing.ImageIcon;
import javax.swing.JOptionPane;

import Entity.MsgPackage;
import GUI.ScreenManager;
import GUI.ViewRequestGui;

public class ViewRequestControl {
	
	private String req_num;
	private MsgPackage view_reqMsg;
	private ViewRequestGui V_req;
	
	public ViewRequestControl(){
		V_req = new ViewRequestGui();
		view_reqMsg = new MsgPackage();
		//req_num = new String();
	}
	
	public ViewRequestGui getV_req(){
		return V_req;
	}
	/**
	 * 
	 * @return
	 */
	public boolean Submit_pressed(){	
	req_num	 = (String)V_req.getReqNum().getSelectedItem();
	if(req_num == null)
	{
		JOptionPane.showMessageDialog(null, "Not all the fileds all the fill", "ERROR", JOptionPane.ERROR_MESSAGE);
       
		return false;
	}
	view_reqMsg.setObject(req_num);
	view_reqMsg.setOp_code(OP_CODE.VIEW_REQUEST);
	ScreenManager.getClient().accept(view_reqMsg);
	return true;
	}	
}